package cn.ad.server.common.utils.monitor;

import java.util.List;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class MonitorHandler {

	private static Logger MONITOR_LOGGER = LogManager.getLogger("logMonitor");

	public static void monitorStrategy(List<String> ids, boolean monitorMode, String monitoredName, String id,
			String alertMessage) {
		if (!monitorMode)
			return;
		if (id != null && ids.contains(id)) {
			MONITOR_LOGGER.info("{}({})'s alert : {}", monitoredName, id, alertMessage);
		}
	}

	public static void monitorAdSpace(List<String> ids, boolean monitorMode, String monitoredName, String id,
			String alertMessage) {
		if (!monitorMode)
			return;
		if (ids != null && ids.contains(id)) {
			MONITOR_LOGGER.info("{}({})'s alert : {}", monitoredName, id, alertMessage);
		}
	}

}
